<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        .one {
            width: 590px;
            height: 470px;
            overflow: hidden;
            position: relative;
        }
        
        .tu {
            width: 4130px;
            height: 470px;
            background-color: rgb(214, 49, 49);
            position: absolute;
        }
        
        .tu li {
            list-style: none;
            float: left;
        }
        
        .tiao {
            position: absolute;
            width: 110px;
            top: 400px;
            left: 0;
            right: 0;
            margin: auto;
            z-index: 3;
        }
        
        li {
            list-style: none;
        }
        
        .tiao li {
            width: 10px;
            height: 10px;
            margin-left: 5px;
            border-radius: 50%;
            list-style: none;
            float: left;
            background-color: rgb(43, 255, 15);
        }
        
        #hou {
            width: 590px;
            height: 470px;
            background-color: rgb(214, 49, 49);
            position: absolute;
            top: 0;
            left: 590px;
        }
    </style>
</head>

<body>
    <div class="one">
        <div class="two">
            <ul class="tu">
                <li><img src="./img/0.webp" alt=""></li>
                <li><img src="./img/1.webp" alt=""></li>
                <li><img src="./img/2.webp" alt=""></li>
                <li><img src="./img/3.webp" alt=""></li>
                <li><img src="./img/4.webp" alt=""></li>
                <li><img src="./img/5.webp" alt=""></li>
                <li><img src="./img/6.webp" alt=""></li>
            </ul>

            <div class="tiao">
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </div>
            <div id="hou">
                <li><img src="./img/0.webp" alt=""></li>
            </div>
        </div>
    </div>
</body>

</html>
<script src="./jquery-3.4.1.min.js"></script>
<script>
    var a = 1;

    setInterval(function() {
        if (a == 7) {
            $("#hou").animate({
                left: 0
            }, 1000);
        }
        if (a == 3) {
            $("#hou").css({
                left: 590
            });
        }
        if (a == 8) {
            a = 2;
        }
        if (a > 7) {
            a = 0
        }
        $(".tu").animate({
            left: -a * 590
        }, 1000);
        a++;
    }, 2000);
    $(".tiao li").hover(function() {
        a = $(this).index();
        $("#tu").animate({
            left: 0
        }, 500);
        // console.log(a);
        // console.log($(this).index())
    }, function() {})
</script>